home *** CD-ROM | disk | FTP | other *** search
- #ifndef CLIB_PCIRES_PROTOS_H
- #define CLIB_PCIRES_PROTOS_H
-
- /*
- ** $VER: pcires_protos.h 1.0 (22.12.97)
- ** Includes Release 1.0
- **
- ** C prototypes. For use with 32 bit integers only.
- **
- ** (C) Copyright 1997-1998 MicroniK
- ** All Rights Reserved
- */
-
- #include <resources/pci.h>
-
- /*
- **
- ** Allow access to PCI bus, to specified PCI area
- ** (IO or MEMORY). Use semaphore-based access control
- ** fill request.request substructure
- ** Do not modify other fields !!!
- **
- */
- ULONG ObtainPCIPage(struct PCIMapping * request);
-
- /*
- **
- ** Frees PCI bus - allow another process to use PCI
- ** Return information about errors on PCI bus
- **
- */
- ULONG ReleasePCIPage(struct PCIMapping * request);
-
- /*
- **
- ** Change PCI bus address - quick way to access other addresses
- ** You cant change space, size and flags
- ** Return information about errors on PCI bus
- **
- */
- ULONG MovePCIPage(struct PCIMapping * request);
-
- /*
- **
- ** Check errors on PCI bus
- ** Return the same information as ReleasePCIPage
- ** but dont change PCI page status
- **
- */
- ULONG PCIPageStatus(struct PCIMapping *request);
-
-
- /*
- **
- ** Read configuration register of PCI card
- ** Return register value or 0xFFFFFFFF if you
- ** select empty slot - usefull only
- ** when reading card ID register (regno = 0)
- **
- */
- ULONG ReadCfgReg(UBYTE slotno, UBYTE regno);
-
- /*
- **
- ** Write configuration register regno of PCI card
- ** plugged into slot no slotno.
- ** Return 1 - OK 0 - slot empty
- **
- */
- ULONG WriteCfgReg(UBYTE slotno, UBYTE regno, ULONG value);
-
- /*
- **
- ** Allocate/init and free PCIMapping structure
- **
- */
- struct PCIMapping * AllocPCIMapping(void);
- void FreePCIMapping(struct PCIMapping * map);
-
-
- /*
- ** for use in interrupt servers
- */
- /*
- **
- ** Allow access to PCI bus, to specified PCI area
- ** (IO or MEMORY). For using in interrupt servers
- ** fill request.request substructure
- ** Do not modify other fields !!!
- **
- */
- ULONG StorePCIPage(struct PCIMapping * request);
-
- /*
- **
- ** Frees PCI bus - allow another process to use PCI
- ** Return information about errors on PCI bus
- ** use in the same interrupt as StorePCIPage -
- ** do not exit interrupt server with PCI page 'stored'
- **
- */
- ULONG RestorePCIPage(struct PCIMapping * request);
-
- /*
- **
- ** Read configuration register of PCI card
- ** Return register value or 0xFFFFFFFF if you
- ** select empty slot - usefull only
- ** when reading card ID register (regno = 0)
- ** For using in single-task environment
- ** eg. in interrupt servers
- **
- */
- ULONG IntReadCfgReg(UBYTE slotno, UBYTE regno);
-
- /*
- **
- ** Write configuration register regno of PCI card
- ** plugged into slot no slotno.
- ** Return 1 - OK 0 - slot empty
- ** For using in single-task environment
- ** eg. in interrupt servers
- **
- */
- ULONG IntWriteCfgReg(UBYTE slotno, UBYTE regno, ULONG value);
-
- #endif /* CLIB_PCIRES_PROTOS_H */
-
-